#include <iostream>
#include <string>
#include <vector>
#include <unordered_set>
using namespace std;
int main() 
{
    string text;
    getline(std::cin, text);

    vector<std::string> words;
    string word;
    
    for (char c : text) 
    {
        if (c == ' ') 
        {
            words.push_back(word);
            word = "";
        } 
        else word += c;
    }
    words.push_back(word);


    int count = 0;
    unordered_set<char> letters = {'А', 'Б', 'В', 'Г', 'Д', 'Е', 'Ё', 'Ж', 'З', 'И', 'Й', 'К', 'Л', 'М', 'Н', 'О', 'П', 'Р', 'С', 'Т', 'У', 'Ф', 'Х', 'Ц', 'Ч', 'Ш', 'Щ', 'Ъ', 'Ы', 'Ь', 'Э', 'Ю', 'Я'};

    for (const auto& word : words)
        if (letters.find(word[0]) != letters.end()) count++;

    std::cout << count;

    return 0;
}